package com.gopay.common.asynexport.service;

import com.gopay.common.PageInfo;
import com.gopay.common.asynexport.constants.FunctionCodeEnum;
import com.gopay.common.asynexport.vo.AsyncExportInfo;

import java.util.List;
import java.util.Map;

/**
 * Created by Adimn on 2017/8/9.
 */
public interface AsynexportService {
    /**
     * 通过sql和参数获取总记录数
     * @param queryCountSql
     * @param queryParam
     * @param dbType
     * @return
     */
    int getTotalCount(String queryCountSql, Map<String, Object> queryParam, String dbType);

    /**
     * 分页查询
     * @param functionCode
     * @param querySql
     * @param queryMap
     * @param pageInfo
     * @param value
     * @return
     */
    List<Object[]> query(String functionCode, String querySql, Map<String, Object> queryMap, PageInfo pageInfo, String value);


    /**
     * 查询数据库
     * @param operId
     * @param queryCountSql
     * @param querySql
     * @param queryMap
     * @param functionCodeEnum
     * @throws Exception
     */
    void insertVo(String filePath,String operId,String operName, String queryCountSql, String querySql, Map queryMap,
                  FunctionCodeEnum functionCodeEnum,String dbType, int hashCode) throws Exception;

    List<AsyncExportInfo> findWaitGenStatAsynExportList();

    void genFile(AsyncExportInfo vo);

    AsyncExportInfo update(AsyncExportInfo vo);

    List<AsyncExportInfo> findWaitCleanAsynExportList(String cleanDateStr);

    AsyncExportInfo findByHashCodeAndSql(int hashCode, String status);

    String cancelById(Long id);
}
